package com.wcn.sell.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wcn.sell.dataobject.OrderDetail;
import com.wcn.sell.enums.OrderStatusEnum;
import com.wcn.sell.enums.PayStatusEnum;
import com.wcn.sell.utils.serializer.Date2LongSerializer;
import lombok.Data;

import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 订单 （数据传输对象）
 */
@Data
//@JsonSerialize(include = JsonSerialize.Inclusion.NON_DEFAULT)
//@JsonInclude(JsonInclude.Include.NON_NULL)
public class OrderDTO {
    /**
     * 订单id.
     */
    private String orderId;
    /**
     * 买家名字.
     */
    private String buyerName;
    /**
     * 买家手机号.
     */
    private String buyerPhone;
    /**
     * 买家地址.
     */
    private String buyerAddress;
    /**
     * 买家微信openid.
     */
    private String buyerOpenid;
    /**
     * 订单金额.
     */
    private BigDecimal orderAmount;
    /**
     * 订单状态,默认为新下单.
     */
    private Integer orderStatus;
    /**
     * 支付状态，默认0未支付.
     */
    private Integer payStatus;
    /**
     * 创建时间.
     */
    @JsonSerialize(using = Date2LongSerializer.class)
    private Date createTime;
    /**
     * 更新时间.
     */
    @JsonSerialize(using = Date2LongSerializer.class)
    private Date updateTime;

    @Transient//数据库对应时忽略
    private List<OrderDetail> orderDetailList;
}
